package com.slz3.business.module.systemManagement.sysRole.domain;

import com.slz3.business.frame.enums.AuditFlag;
import com.slz3.business.frame.enums.UsingFlag;
import com.slz3.business.frame.functions.Add;
import com.slz3.business.frame.functions.Modify;
import com.slz3.business.frame.module.DomainEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static javax.persistence.EnumType.STRING;

@MappedSuperclass
@Data
@EqualsAndHashCode(callSuper = false)
public class SysRoleEntity extends DomainEntity {

    /**
     * 编号
     */
    @Column(length = 80)
   // @NotNull(message = "serNum 必须非空!", groups = {Add.class, Modify.class})
    @Length(min = 1, max = 80, message = "ser2 必须非空并且不超过 80 个字符!", groups = {Add.class, Modify.class})
    private String serNum;

    /**
     * 备注
     */
    @Basic(fetch = FetchType.LAZY)
    @Type(type = "text")
    private String serMemo;

    /**
     * 审核状态
     */
    @Enumerated(STRING)
  //  @NotNull(message = "serAudit 必须非空!", groups = {Add.class, Modify.class})
    private AuditFlag serAudit;

    /**
     * 启用状态
     */
    @Enumerated(STRING)
   // @NotNull(message = "serUsing 必须非空!", groups = {Add.class, Modify.class})
    private UsingFlag serUsing;

    /**
     * 标签
     */
    private String serLabels;

    private String serCode;

   // @NotNull(message = "{TT.ZMD.SysBasicRole.serName}必填", groups = {Add.class, Modify.class})
   // @Size(min = 1, max = 90, message = "{TT.ZMD.SysBasicRole.serName}长度长度必须大于 1 小于 90 个字符", groups = {Add.class, Modify.class})
    private String serName;

}
